
import java.io.Serializable;

/**
 * Created by IntelliJ IDEA.
 * User: nelson
 */
public class Address implements Serializable {

    private int port;
    private int capacity;
    private String host;

    public Address(Address a) {
        this.port = a.getPort();
        this.host = a.getHost();
    }

    public int getCapacity() {
        return capacity;
    }

    public void setCapacity(int capacity) {
        this.capacity = capacity;
    }

    public Address(int port, String host) {
        this.port = port;
        this.host = host;
    }

    public int getPort() {
        return this.port;
    }

    public String getHost() {
        return this.host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public Address clone() {
        return (new Address(this));
    }
    public boolean equals(Object s){
        if(s instanceof Address){
            Address aux = (Address) s;
            return (aux.port== this.port && aux.host.equals(this.host) && aux.capacity == this.capacity);
        }else{
            return false;
        }
    }

}
